home *** CD-ROM | disk | FTP | other *** search
- package sub_arctic.lib;
- import sub_arctic.input.*;
-
- /**
- * This is the superclass for all objects which can be put on a
- * menu and understand the highlighting behavior. (Other interactors can
- * be placed in a menu, they just won't highlight.)
- * @author Ian Smith
- */
- public class menu_item extends base_interactor {
-
- // this behavior should really be defined in an interface
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * State of the object
- */
- boolean _highlighted;
-
- /**
- * Query the state of the highlighting.
- * @return boolean true if this object is currently highlighted
- */
- boolean highlighted() { return _highlighted;};
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * This is called to make this object highlight.
- * @param event evt the event that caused us to be highlighted
- */
- public void highlight(event evt) {
- _highlighted=true;
- /* we do this so subclasses with simple drawing behavior
- can just test the highlighted() value and redraw */
- damage_self();
- }
-
- //had:
- //* @exception general PROPAGATED
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * This is called to make this object unhighlight.
- * @param event evt the event that caused us to be unhighlighted
- */
- public void unhighlight(event evt) {
- _highlighted=false;
- /* we do this so subclasses with simple drawing behavior
- can just test the highlighted() value and redraw */
- damage_self();
- }
-
- //had:
- //* @exception general PROPAGATED
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * We don't force a width or height on you here... we assume
- * you are going to be a menu which will force the issue.
- */
- public menu_item() {
- super(0,0);
- _highlighted=false;
- }
-
- //had:
- //* @exception general PROPAGATED
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
- }
- /*=========================== COPYRIGHT NOTICE ===========================
-
- This file is part of the subArctic user interface toolkit.
-
- Copyright (c) 1996 Scott Hudson and Ian Smith
- All rights reserved.
-
- The subArctic system is freely available for most uses under the terms
- and conditions described in
- http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html
- and appearing in full in the lib/interactor.java source file.
-
- The current release and additional information about this software can be
- found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
-
- ========================================================================*/
-